package com.hzf.workman.dao.model;

import java.io.Serializable;
import java.util.Date;

public class WorkmanDemand implements Comparable,Serializable {
    /**
     * 主键
     *
     * @mbg.generated
     */
    private Integer id;

    /**
     * 关联用户ID(工人ID)
     *
     * @mbg.generated
     */
    private Integer userId;

    /**
     * 小区所在市
     *
     * @mbg.generated
     */
    private Integer city;

    /**
     * 小区所在位置
     *
     * @mbg.generated
     */
    private String address;

    /**
     * 小区名称
     *
     * @mbg.generated
     */
    private String callName;

    /**
     * 房屋卧室数量
     *
     * @mbg.generated
     */
    private Integer callRoom;

    /**
     * 房屋客厅数量
     *
     * @mbg.generated
     */
    private Integer callHall;

    /**
     * 房屋卫生间数量
     *
     * @mbg.generated
     */
    private Integer callToilet;

    /**
     * 面积（平方米为单位）
     *
     * @mbg.generated
     */
    private Integer callAcreage;

    /**
     * 楼号
     *
     * @mbg.generated
     */
    private Integer callNo;

    /**
     * 单元
     *
     * @mbg.generated
     */
    private Integer callUnit;

    /**
     * 房号
     *
     * @mbg.generated
     */
    private Integer callHouse;

    /**
     * 联系手机号
     *
     * @mbg.generated
     */
    private Long callPhone;

    /**
     * 微信号
     *
     * @mbg.generated
     */
    private String callWechat;

    /**
     * 装修预算
     *
     * @mbg.generated
     */
    private String callBudget;

    /**
     * 需求状态：0：待接单，1：待选标，2：已选标，3：制作中，4：已结单，5：已评价
     *
     * @mbg.generated
     */
    private Integer demandType;

    /**
     * 用户最近创建时间
     *
     * @mbg.generated
     */
    private Date updateTime;

    /**
     * 用户最近操作时间
     *
     * @mbg.generated
     */
    private Date createDate;

    /**
     * 维度
     *
     * @mbg.generated
     */
    private Double lng;

    /**
     * 经度
     *
     * @mbg.generated
     */
    private Double lat;

    /**
     * 编码
     *
     * @mbg.generated
     */
    private Long geoCode;

    /**
     * 风格ID
     *
     * @mbg.generated
     */
    private Integer styleId;

    /**
     * 案例ID
     *
     * @mbg.generated
     */
    private Integer styleAnli;

    private double distanceKm;

    private String  demandInfo;

    private WorkmanBid workmanBid;


    private String createTime;

    private static final long serialVersionUID = 1L;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getCity() {
        return city;
    }

    public void setCity(Integer city) {
        this.city = city;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getCallName() {
        return callName;
    }

    public void setCallName(String callName) {
        this.callName = callName;
    }

    public Integer getCallRoom() {
        return callRoom;
    }

    public void setCallRoom(Integer callRoom) {
        this.callRoom = callRoom;
    }

    public Integer getCallHall() {
        return callHall;
    }

    public void setCallHall(Integer callHall) {
        this.callHall = callHall;
    }

    public Integer getCallToilet() {
        return callToilet;
    }

    public void setCallToilet(Integer callToilet) {
        this.callToilet = callToilet;
    }

    public Integer getCallAcreage() {
        return callAcreage;
    }

    public void setCallAcreage(Integer callAcreage) {
        this.callAcreage = callAcreage;
    }

    public Integer getCallNo() {
        return callNo;
    }

    public void setCallNo(Integer callNo) {
        this.callNo = callNo;
    }

    public Integer getCallUnit() {
        return callUnit;
    }

    public void setCallUnit(Integer callUnit) {
        this.callUnit = callUnit;
    }

    public Integer getCallHouse() {
        return callHouse;
    }

    public void setCallHouse(Integer callHouse) {
        this.callHouse = callHouse;
    }

    public Long getCallPhone() {
        return callPhone;
    }

    public void setCallPhone(Long callPhone) {
        this.callPhone = callPhone;
    }

    public String getCallWechat() {
        return callWechat;
    }

    public void setCallWechat(String callWechat) {
        this.callWechat = callWechat;
    }

    public String getCallBudget() {
        return callBudget;
    }

    public void setCallBudget(String callBudget) {
        this.callBudget = callBudget;
    }

    public Integer getDemandType() {
        return demandType;
    }

    public void setDemandType(Integer demandType) {
        this.demandType = demandType;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Double getLng() {
        return lng;
    }

    public void setLng(Double lng) {
        this.lng = lng;
    }

    public Double getLat() {
        return lat;
    }

    public void setLat(Double lat) {
        this.lat = lat;
    }

    public Long getGeoCode() {
        return geoCode;
    }

    public void setGeoCode(Long geoCode) {
        this.geoCode = geoCode;
    }

    public Integer getStyleId() {
        return styleId;
    }

    public void setStyleId(Integer styleId) {
        this.styleId = styleId;
    }

    public Integer getStyleAnli() {
        return styleAnli;
    }

    public void setStyleAnli(Integer styleAnli) {
        this.styleAnli = styleAnli;
    }

    public double getDistanceKm() {
        return distanceKm;
    }

    public void setDistanceKm(double distanceKm) {
        this.distanceKm = distanceKm;
    }

    public String getDemandInfo() {
        return demandInfo;
    }

    public void setDemandInfo(String demandInfo) {
        this.demandInfo = demandInfo;
    }

    public WorkmanBid getWorkmanBid() {
        return workmanBid;
    }

    public void setWorkmanBid(WorkmanBid workmanBid) {
        this.workmanBid = workmanBid;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userId=").append(userId);
        sb.append(", city=").append(city);
        sb.append(", address=").append(address);
        sb.append(", callName=").append(callName);
        sb.append(", callRoom=").append(callRoom);
        sb.append(", callHall=").append(callHall);
        sb.append(", callToilet=").append(callToilet);
        sb.append(", callAcreage=").append(callAcreage);
        sb.append(", callNo=").append(callNo);
        sb.append(", callUnit=").append(callUnit);
        sb.append(", callHouse=").append(callHouse);
        sb.append(", callPhone=").append(callPhone);
        sb.append(", callWechat=").append(callWechat);
        sb.append(", callBudget=").append(callBudget);
        sb.append(", demandType=").append(demandType);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", createDate=").append(createDate);
        sb.append(", lng=").append(lng);
        sb.append(", lat=").append(lat);
        sb.append(", geoCode=").append(geoCode);
        sb.append(", styleId=").append(styleId);
        sb.append(", styleAnli=").append(styleAnli);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        WorkmanDemand other = (WorkmanDemand) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getCity() == null ? other.getCity() == null : this.getCity().equals(other.getCity()))
            && (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress()))
            && (this.getCallName() == null ? other.getCallName() == null : this.getCallName().equals(other.getCallName()))
            && (this.getCallRoom() == null ? other.getCallRoom() == null : this.getCallRoom().equals(other.getCallRoom()))
            && (this.getCallHall() == null ? other.getCallHall() == null : this.getCallHall().equals(other.getCallHall()))
            && (this.getCallToilet() == null ? other.getCallToilet() == null : this.getCallToilet().equals(other.getCallToilet()))
            && (this.getCallAcreage() == null ? other.getCallAcreage() == null : this.getCallAcreage().equals(other.getCallAcreage()))
            && (this.getCallNo() == null ? other.getCallNo() == null : this.getCallNo().equals(other.getCallNo()))
            && (this.getCallUnit() == null ? other.getCallUnit() == null : this.getCallUnit().equals(other.getCallUnit()))
            && (this.getCallHouse() == null ? other.getCallHouse() == null : this.getCallHouse().equals(other.getCallHouse()))
            && (this.getCallPhone() == null ? other.getCallPhone() == null : this.getCallPhone().equals(other.getCallPhone()))
            && (this.getCallWechat() == null ? other.getCallWechat() == null : this.getCallWechat().equals(other.getCallWechat()))
            && (this.getCallBudget() == null ? other.getCallBudget() == null : this.getCallBudget().equals(other.getCallBudget()))
            && (this.getDemandType() == null ? other.getDemandType() == null : this.getDemandType().equals(other.getDemandType()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getCreateDate() == null ? other.getCreateDate() == null : this.getCreateDate().equals(other.getCreateDate()))
            && (this.getLng() == null ? other.getLng() == null : this.getLng().equals(other.getLng()))
            && (this.getLat() == null ? other.getLat() == null : this.getLat().equals(other.getLat()))
            && (this.getGeoCode() == null ? other.getGeoCode() == null : this.getGeoCode().equals(other.getGeoCode()))
            && (this.getStyleId() == null ? other.getStyleId() == null : this.getStyleId().equals(other.getStyleId()))
            && (this.getStyleAnli() == null ? other.getStyleAnli() == null : this.getStyleAnli().equals(other.getStyleAnli()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getCity() == null) ? 0 : getCity().hashCode());
        result = prime * result + ((getAddress() == null) ? 0 : getAddress().hashCode());
        result = prime * result + ((getCallName() == null) ? 0 : getCallName().hashCode());
        result = prime * result + ((getCallRoom() == null) ? 0 : getCallRoom().hashCode());
        result = prime * result + ((getCallHall() == null) ? 0 : getCallHall().hashCode());
        result = prime * result + ((getCallToilet() == null) ? 0 : getCallToilet().hashCode());
        result = prime * result + ((getCallAcreage() == null) ? 0 : getCallAcreage().hashCode());
        result = prime * result + ((getCallNo() == null) ? 0 : getCallNo().hashCode());
        result = prime * result + ((getCallUnit() == null) ? 0 : getCallUnit().hashCode());
        result = prime * result + ((getCallHouse() == null) ? 0 : getCallHouse().hashCode());
        result = prime * result + ((getCallPhone() == null) ? 0 : getCallPhone().hashCode());
        result = prime * result + ((getCallWechat() == null) ? 0 : getCallWechat().hashCode());
        result = prime * result + ((getCallBudget() == null) ? 0 : getCallBudget().hashCode());
        result = prime * result + ((getDemandType() == null) ? 0 : getDemandType().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
        result = prime * result + ((getLng() == null) ? 0 : getLng().hashCode());
        result = prime * result + ((getLat() == null) ? 0 : getLat().hashCode());
        result = prime * result + ((getGeoCode() == null) ? 0 : getGeoCode().hashCode());
        result = prime * result + ((getStyleId() == null) ? 0 : getStyleId().hashCode());
        result = prime * result + ((getStyleAnli() == null) ? 0 : getStyleAnli().hashCode());
        return result;
    }
    @Override
    public int compareTo(Object o) {
        WorkmanDemand p = (WorkmanDemand) o;
        if(p.distanceKm<this.distanceKm){
            return 1;
        }
        else if(p.distanceKm>this.distanceKm){
            return -1;
        }
        else{
            return 0;
        }

    }
}